<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8"/>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Cache-Control" content="no-cache,must-revalidate"/>
    <meta http-equiv="Expires" content="0"/>
    <meta http-equiv="Cache" content="no-cache"/>
    <title>设备截图</title>
    <script type="text/javascript" th:src="@{/lib/jquery-3.3.1.js}"></script>
    <title>设备管理平台</title>
</head>
<body>

<div id="header">
    设备管理平台
</div>

<div id="software">
    <div id="softwareUpdate" class="module">
        <h2>软件更新</h2>
        <form action="/apk/update" method="post" enctype="multipart/form-data">
            <table>
                <tr>
                    <td>
                        批量:
                        <input id="checkbox0" type="checkbox" name="all" onclick="changeSoftUpdateDeviceShow(this)"/>
                    </td>
                    <td>
                        <div id="unique_device0" style="margin-left:30px">
                            设备编号:<br/>
                            <input type="text" name="deviceID" value=""/>
                            <br/>
                            屏幕编号:<br/>
                            <input type="text" name="screenID" value=""/>
                        </div>
                    </td>
                </tr>
            </table>
            <br/>
            软件包名:<br/>
            <input type="text" name="package" value=""/>
            <br/>
            版本名称:<br/>
            <input type="text" name="versionName" value=""/>
            <br/>
            版本号 :<br/>
            <input type="text" name="versionCode" value=""/>
            <br/>
            升级文件:<br/>
            <input type="file" name="apk"/>
            <br/>
            重启:
            <input type="checkbox" name="reboot"/>
            <br/>
            <input type="submit" name="更新"/>
        </form>
    </div>

    <div id="softwareInstall" class="module">
        <h2>软件安装</h2>
        <form action="/apk/install" method="post" enctype="multipart/form-data">

            <table>
                <tr>
                    <td>
                        批量:
                        <input id="checkbox1" type="checkbox" name="all" onclick="changeSoftInstallDeviceShow(this)"/>
                    </td>
                    <td>
                        <div id="unique_device1" style="margin-left:30px">
                            设备编号:<br/>
                            <input type="text" name="deviceID" value=""/>
                            <br/>
                            屏幕编号:<br/>
                            <input type="text" name="screenID" value=""/>
                        </div>
                    </td>
                </tr>
            </table>
            <br/>
            软件包名:<br/>
            <input type="text" name="package" value=""/>
            <br/>
            升级文件:<br/>
            <input type="file" name="apk"/>
            <br/>
            重启:
            <input type="checkbox" name="reboot"/>
            <br/>
            <input type="submit" name="更新"/>
        </form>
    </div>

    <div id="softwareUninstall" class="module">
        <h2>软件卸载</h2>
        <form action="/apk/unInstall" method="post" enctype="multipart/form-data">

            <table>
                <tr>
                    <td>
                        批量:
                        <input id="checkbox2" type="checkbox" name="all" onclick="changeSoftUninstallDeviceShow(this)"/>
                    </td>
                    <td>
                        <div id="unique_device2" style="margin-left:30px">
                            设备编号:<br/>
                            <input type="text" name="deviceID" value=""/>
                            <br/>
                            屏幕编号:<br/>
                            <input type="text" name="screenID" value=""/>
                        </div>
                    </td>
                </tr>
            </table>

            <br/>
            软件包名:<br/>
            <input type="text" name="package" value=""/>
            <br/>
            重启:
            <input type="checkbox" name="reboot"/>
            <br/>
            <input type="submit" name="更新"/>
        </form>
    </div>
</div>


<hr/>  <!--画一条线-->

<div id="resource" class="module">
    <h2>资源包更新</h2>
    <form action="/apk/updateRes" method="post" enctype="multipart/form-data">
        <table>
            <tr>
                <td>
                    批量:
                    <input id="checkbox3" type="checkbox" name="all" onclick="changeResUniqueDeviceShow(this)"/>
                </td>
                <td>
                    <div id="unique_device3" style="margin-left:30px">
                        设备编号:<br/>
                        <input type="text" name="deviceID" value=""/>
                        <br/>
                        屏幕编号:<br/>
                        <input type="text" name="screenID" value=""/>
                    </div>
                </td>
            </tr>
        </table>
        <br/>
        单文件:
        <input type="checkbox" name="isFile"/>
        <br/>
        软件包名:<br/>
        <input type="text" name="package" value=""/>
        <br/>
        资源路径:<br/>
        <input type="text" name="resPath" value=""/>
        <br/>
        资源文件:<br/>
        <input type="file" name="resource"/>
        <br/>
        重启:
        <input type="checkbox" name="reboot"/>
        <br/>
        <input type="submit" name="更新"/>
    </form>
</div>

<hr/>  <!--画一条线-->

<div id="version" class="module">
    <h2>版本查询</h2>
    <form method="post" action="/apk/version" enctype="multipart/form-data">
        <table>
            <tr>
                <td>
                    批量:
                    <input id="checkbox4" type="checkbox" name="all" onclick="changeVersionUniqueDeviceShow(this)"/>
                </td>
                <td>
                    <div id="unique_device4" style="margin-left:30px">
                        设备编号:<br/>
                        <input type="text" name="deviceID" value=""/>
                        <br/>
                        屏幕编号:<br/>
                        <input type="text" name="screenID" value=""/>
                    </div>
                </td>
            </tr>
        </table>
        <br/>
        软件列表：<a href="#" id="AddMoreTextBox">添加输入框</a>
        <br/>
        <div id="InputsWrapper">
            <input type="text" name="packages[]" id="package_1" value="Text 1"/><br/><br/>
            <input type="text" name="packages[]" id="package_2" value="Text 2"/><br/><br/>
            <input type="text" name="packages[]" id="package_3" value="Text 3"/><br/><br/>
        </div>
        <input type="submit" name="edit" value="提交"/>
    </form>
</div>

<div id="footer">
    &copy; 2019, Hisense
    <br/>
    The right of final interpretation belongs to our company.
</div>
</body>

<script type="text/javascript">
    /*<![CDATA[*/

     $(document).ready(function () {
            var InputCount=3;
            $("#AddMoreTextBox").click(function (e)
            {
                InputCount++;
                $("#InputsWrapper").append('<label></label><input type="text" name="packages[]" id="package_' + InputCount + '" value="Text '+ InputCount +'"/><br/><br/>');
            });
     });

     function changeVersionUniqueDeviceShow(checkbox) {
            if(checkbox.checked) {
                $("#unique_device4")[0].style.visibility = "collapse";
            }else {
                $("#unique_device4")[0].style.visibility = "visible";
            }
     }

     function changeResUniqueDeviceShow(checkbox) {
            if(checkbox.checked) {
                $("#unique_device3")[0].style.visibility = "collapse";
            }else {
                $("#unique_device3")[0].style.visibility = "visible";
            }
     }

     function changeSoftUninstallDeviceShow(checkbox) {
            if(checkbox.checked) {
                $("#unique_device2")[0].style.visibility = "collapse";
            }else {
                $("#unique_device2")[0].style.visibility = "visible";
            }
     }

     function changeSoftInstallDeviceShow(checkbox) {
            if(checkbox.checked) {
                $("#unique_device1")[0].style.visibility = "collapse";
            }else {
                $("#unique_device1")[0].style.visibility = "visible";
            }
     }

      function changeSoftUpdateDeviceShow(checkbox) {
            if(checkbox.checked) {
                $("#unique_device0")[0].style.visibility = "collapse";
            }else {
                $("#unique_device0")[0].style.visibility = "visible";
            }
     }

    /*]]>*/


</script>

<style type="text/css">
      body {
           background-color:#888396;
      }

      .module {
          border: 1px #636363 solid;
          padding: 45px;
      }

      #header {
           background-color:#b5a789;
           margin:10px;
           height:48px;
           text-align:center;
      }

      #software {
        margin:0 auto;
        display:flex;
      }

      #softwareUpdate {
        display:inline-block;
      }

      #softwareUninstall {
        display:inline-block;
      }

      #softwareInstall {
        display:inline-block;
      }

      #resource {
       background: top right;
      }

      #footer {
       background-color:#675c47;
       color:#efe5d0;
       text-align:center;
       padding:15px;
       margin:0px 10px 10px 10px;
       font-size:90%;
      }
</style>
</html>
